<%-- 
    Document   : index
    Created on : Jul 7, 2011, 1:23:40 AM
    Author     : Thanhluan216
--%>

<%@page import="server.entity.Category"%>
<%@page import="server.process.ProcessBeanLocal"%>
<%@page import="javax.naming.Context"%>
<%@page import="javax.naming.InitialContext"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<jsp:include page="header.jsp"></jsp:include>
            <div id="main">
                <div id="slidebar">
                    <div id="login">
                        <jsp:include page="login.jsp"></jsp:include>
                    </div>
                    <div id="search">
                        <jsp:include page="search.jsp"></jsp:include>
                    </div>
                    <div id="product">
                        <jsp:include page="categorypanel.jsp"></jsp:include>
                    </div>
                </div>
                <div id="content">
                    <a href="#">Home</a>-><a href="#">My Collection</a>-><a href="#">Update Collection</a>
                    <br/>
                    <form action="doUploadCategory" method="POST" enctype="multipart/form-data">
                        <h2>update Collection</h2>
                        <%
                            String id = request.getParameter("id");
                            Context ctx = new InitialContext();
                            ProcessBeanLocal local = (ProcessBeanLocal) ctx.lookup("ProcessLocalJNDI");
                            Category category=local.findbyCollectionID(id);
                        %>
                        <table border="0">
                            <tr>

                                <td>Collection Name</td>

                                <td><input type="text" name="txtColName" value="<%=category.getCollectionName()%>"/>
                            </tr>
                            <tr>
                                <td>Description:</td>
                                <td><input type="text" name="txtDescription" value="<%=category.getCollectionDescription()%>"/>
                            </tr>
                            <tr>
                                <td>Collection Image</td>
                                <td>
                                    <input type="file" name="image" value="" />
                                    <input type="hidden" name="ktimage" value="<%= category.getImage() %>"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <input type="hidden" value="<%=id%>" name="id"/>
                                    <input type="hidden" name="fromPage" value="updatecolection"/>
                                    <input type="submit" name="action" value="Create"/></td>
                                <td><input type="reset" name="reset" value="Cancel"/></td>
                            </tr>
                        </table>
                    </form>

                </div>
            </div>
            <div id="footer">

            </div>
        </div>
    </body>
</html>
